package com.chinasoft.movies.controller;

import com.chinasoft.movies.pojo.DirectorByRevAndPop;
import com.chinasoft.movies.service.DirectorByRevAndPopService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Log4j2
@CrossOrigin
public class DirectorByRevAndPopController {

    @Autowired
    DirectorByRevAndPopService directorByRevAndPopService;

    //查询票房前十和热度前十的导演的并集
    //返回：String director; Long sumRevenue; double avgPopularity;
    @GetMapping("/queryDirectorByRevAndPop")
    public List<DirectorByRevAndPop> queryDirectorByRevAndPop(){
        List<DirectorByRevAndPop> result = directorByRevAndPopService.queryDirectorByRevAndPop();
        return result;
    }
}
